home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
asmutil
/
ps18a12.zip
/
A18.DOC
< prev
next >
Wrap
Text File
|
1987-03-15
|
38KB
|
1,100 lines
PseudoSam 18 Assembler Manual V1.2.02
Copyright(c) 1986 PseudoCode
Disclaimer:
PseudoSam 18 is distributed as is, with no guarantee that it
will work correctly in all situations. In no event will the
Author be liable for any damages, including lost profits,
lost savings or other incidental or consequential damages
arising out of the use of or inability to use these
programs, even if the Author has been advised of the
possibility of such damages, or for any claim by any other
party.
It is the users reponsibility to back up all important files!
See copyright information in appendix B
Table of Contents
Chapter 1 PseudoSam 18 assembler vs. the RCA assembler.
Chapter 2 Running the assembler program.
Chapter 3 Assembler statement syntax.
Chapter 4 Data types.
Chapter 5 Expressions.
Chapter 6 Assembler Directives.
(also known as assembler pseudo-opcodes, or pseudo-ops)
Appendix A ASCII character set.
Appendix B Copyright and registration information.
Appendix C Description of Files.
Appendix D Bug Reporting Procedure.
Appendix E Using PseudoSam 18 on "Compatible" Systems.
Chapter 1 PseudoSam 18 assembler vs. the RCA assembler
All PseudoSam(Pseudo brand Symbolic AsseMbler) assemblers conform to
a common syntax based on the UNIX system V assembler syntax. By
conforming to this Pseudo standard, conflicts with the manufacturers
syntax are created. Below is a brief and incomplete list of those
conflicts.
RCA format level 1 PseudoSam format
<identifier> equ <expression> .equ <identifier> , <expression>
<identifier> set <expression> .set <identifier> , <expression>
Has Macro capability No Macro capability at this time
..coments are delimited by ;coments are delimited by
.. two periods ; a single semicolon
* The difference between the RCA and the PseudoSam name
of an assembler directive can be circumvented by the .opdef
directive.
example
.opdef eject,.eject ;defines eject to be synonymous with .eject
* A file syn.asm is distributed with the assembler with some useful
redefinitions.
Unix system V is a trademark of AT & T.
Chapter 2 Running the assembler program
1. Command line switch setting and source file specification.
Assuming the user has an assembly language source file called foo.asm
type the following command:
a18 foo
The assembler will assemble the program foo.asm using the default
assembler switch settings. the following files will be generated
by the assembler:
foo.lst ;assembled listing shown the code conversion and
; any errors that where discover by the assembler.
foo.obj ;assembled object code in Motorola Hex format.
** for a list of switch setting see the .command assembler directive
description in chapter 6.
*** The assembler uses the following temporary file names.
z0z0z0z0.tmp
z1z1z1z1.tmp
ANY files with these names will be DESTROYED by the
by the assembler.
Chapter 3 Assembler statement syntax
1. Assembler Statements
Assembler statements contain from zero to 4 fields as shown in
following.
<label> <opcode> <expressions> <comment>
All fields are optional, but they must be in this order.
A. Labels (<label>) are symbolic names that are assigned the starting
address of any code generated by the opcode and or expressions
of the line containing the label declaration.(see section 2).
B. Operation codes(<opcode>) tell the assembler what machine instruction
to generate, or what assembler control function to perform.
The operation code also tells the assembler what expressions are
required to complete the machine instruction or assembler directive.
(see chapter 6).
C. Expression requirements are set by the opcode(see the microprocessor
manufacturers reference manual or the assembler directives chapter
for individual opcode requirements).(see chapter 5).
D. Comments are notes written by the programmer to explain what the
program is trying to accomplish. Comments generate no code.
(see section 3).
2. Labels
Labels can be unlimited in length, but only the first eight characters
are used to distinguish between them. They must conform to the
following syntax.
<label> -> <identifier>':'
<identifier> -> <alphabetic character> <identifier character string>
<alphabetic character> -> character in the set ['A'..'Z', 'a'..'z', '.']
<identifier character string> -> any sequence of characters from the
set ['A'..'Z','a'..'z', '.', '0'..'9']
example
abc: ;label referred to as abc
a c: ;not a valid label
foo: ;label referred to as foo
.123: ;label referred to as .123
* Case makes NO difference!
d: ;is the same as
D:
3. Comments
Comments must start with a semi-colon ; and are terminated
by an end of line or file( <lf>(^J) or <sub>(^Z) ). An end
of line is inserted by typing the enter or return key by
most text editors.
Chapter 4 Data types
1. Integers
Integer constants can be specified in any of the following forms:
A. Binary
b'bb ;bb=string of binary digits
B'bb
B. Decimal
ndd
d'dd ;n=nozero decimal digit
D'dd ;dd=string of decimal digits
C. Octal
0qq ;qq=string of octal digits
o'qq
O'qq
q'qq
Q'qq
D. Hexidecimal
0x'hh ;hh=string of hexidecimal digits
0X'hh
h'hh
H'hh
x'hh
X'hh
Examples:
077 ;octal number 77 = decimal 63
b'0101 ;binary number 101 = decimal 5
77 ;decimal number 77 = octal 115
h'ff ;hexidecimal ff = decimal 255
2. Strings:
Strings consist of a beginning quote " followed by any reasonable number
of characters followed by an ending quote ". Control characters and double
quotes " and backslash \ may not be used in strings directly. These
special characters are included by using a special escape sequence which
the assembler translates into the appropriate ASCII code.
Note: Strings may not be used in expressions!
Although character constants may(see below).
Escape sequences
"\"" string containing "
"\\" string containing \
"\'" string containing '
"\0" string containing null
"\n" string containing linefeed
"\r" string containing carriage return
"\f" string containing formfeed
"\t" string containing horizontal tab
"\nnn" string containing the ASCII character who's code is o'nnn
(nnn are octal digits).
* see appendix A for ASCII codes.
3. Character Constants:
Character constants consist of a single quote ' followed by
a character or an escape sequence(see above) followed by a
single quote '.
example:
'A' = ASCII character value for the letter A = 65 (decimal);
'\''= ASCII character value for the character ' = 39 (decimal).
Character constants are treated as integers by the assembler and
are valid where ever an integer value is valid.
example:
'A' + 1 = 66
* see appendix A for ASCII codes.
4. Symbolic values
Symbolic values are generally labels, but may be any identifier
assigned an integer value(using .set or .equ pseudo-ops).
As a special case the symbol * when used as an operand in an
expression denotes the value of the location counter (the